const omitBy =
	(obj, fn) =>
	Object.keys(obj)
	.filter(k => !fn(obj[k], k))
	.reduce((acc, key) => ((acc[key] = obj[key]), acc), {});

function omitEmptyProps(object) {
	return omitBy(
		object,
		value => value === undefined || value === null || value === '',
	);
}

export default omitEmptyProps;
